package com.steak.orm.factory;

import com.steak.orm.builder.DeleteSQLBuilder;
import com.steak.orm.builder.QuerySQLBuilder;
import com.steak.orm.builder.SaveSQLBuilder;
import com.steak.orm.builder.UpdateSQLBuilder;

/**
 * @author 刘牌
 * @Title:
 * @date 2022/3/412:42
 */
public class SQLBuilderInstanceFactory {
    static QuerySQLBuilder queryBuilder = null;
    static SaveSQLBuilder saveBuilder = null;
    static UpdateSQLBuilder updateBuilder = null;
    static DeleteSQLBuilder deleteSQLBuilder = null;
    public static QuerySQLBuilder getQueryBuilder(){
        if (queryBuilder == null) queryBuilder = new QuerySQLBuilder();
        return queryBuilder;
    }

    public static SaveSQLBuilder getSaveBuilder(){
        if (saveBuilder == null) saveBuilder = new SaveSQLBuilder();
        return saveBuilder;
    }

    public static UpdateSQLBuilder getUpdateBuilder(){
        if (updateBuilder == null) updateBuilder = new UpdateSQLBuilder();
        return updateBuilder;
    }

    public static DeleteSQLBuilder getDeleteSQLBuilder(){
        if (deleteSQLBuilder == null) deleteSQLBuilder = new DeleteSQLBuilder();
        return deleteSQLBuilder;
    }
}
